package com.caiden_micheal.org.web;

import com.caiden_micheal.base.aop.annotation.PermissionVerify;
import com.caiden_micheal.base.domain.AjxResult;
import com.caiden_micheal.org.service.OrgService;
import com.caiden_micheal.org.vo.OrgAddPermissionVO;
import com.caiden_micheal.org.vo.OrgPermissionRemoveVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/org")
public class OrgPermissionController {
    @Autowired
    private OrgService orgService;

    @PermissionVerify(permissionArray = {"sys:orgManagement:assignPermission"})
    @PostMapping("/orgAddPermission")
    public AjxResult orgAddPermission(@RequestBody OrgAddPermissionVO orgAddPermissionVO) {
        return orgService.orgAddPermission(orgAddPermissionVO);
    }

    @PermissionVerify(permissionArray = {"sys:orgManagement:assignPermission"})
    @PostMapping("/orgRemoveAuthority")
    public AjxResult orgRemoveAuthority(@RequestBody OrgPermissionRemoveVO orgPermissionRemoveVO) {
        return orgService.orgRemoveAuthority(orgPermissionRemoveVO);
    }
}
